package com.ywb.mapper;

import com.ywb.pojo.Category;
import com.ywb.pojo.CategoryQueryParam;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CategoryMapper {
    @Select("select * from category order by category_id  ")
    List<Category> findAll();

    @Delete("delete from category where category_id=#{id}")
    void deleteById(Integer id);

    @Insert("insert into category(category_name) values (#{categoryName})")
    void insert(Category category);

    @Select("select * from category where category_id=#{id}")
    Category getById(Integer categoryid);

    @Update("update category set category_name=#{categoryName} where category_id=#{categoryId}")
    void update(Category category);

    List<Category> list(CategoryQueryParam categoryQueryParam);
}
